<template>
	<view class="padb10">
		<stop isBack>
			<view slot="content">物资领取单详情</view>
		</stop>
		
		<view class="bdtso">
			<view class="tac" v-if="objval(log,['logs',0,'storeLog','status'])">
				<status classes="pad3" :item="objval(log,['logs',0,'storeLog','status'])"></status>
			</view>
		</view>
		
		<view class="bcf pad2 mar2" v-if="isbool(log)">
			<!-- {{log}} -->
			<store-form :item.sync="log"></store-form>
		</view>
		<view class="padlr3" v-if="isbool(log.machine)">
			<view class="lh2 bcf pad2 bdtso mart3">
				<view class="list-style-2 flrc">
					<view class="flex1">关联的设备</view>
				</view>
				<!-- 显示选择的设备 -->
				<view class="flrc pad3 bdso bc13 mart3" >
					<machine-item class="w100" :iri="log.machine" ></machine-item>
				</view>
			</view>
		</view>
		<view class="padlr3" v-if="isbool(log.breakOrder)">
			<view class="lh2 bcf pad2 bdtso mart3">
				<view class="list-style-2 flrc">
					<view class="flex1">关联的设备</view>
				</view>
				<!-- 显示选择的设备 -->
				<view class="flrc pad3 bdso bc13 mart3" >
					<view class="flex1">{{log.breakOrder.sn}}</view>
					<view class="cu-btn line-green sm" @tap="copy(log.breakOrder.sn)">复制</view>
				</view>
			</view>
		</view>
		<view class="padlr3" v-if="isbool(log.maintainOrder)">
			<view class="lh2 bcf pad2 bdtso mart3">
				<view class="list-style-2 flrc">
					<view class="flex1">关联的设备</view>
				</view>
				<!-- 显示选择的设备 -->
				<view class="flrc pad3 bdso bc13 mart3" >
					<view class="flex1">{{log.maintainOrder.sn}}</view>
					<view class="cu-btn line-green sm" @tap="copy(log.maintainOrder.sn)">复制</view>
				</view>
			</view>
		</view>
		
		<loading :loading="myIsLoading"></loading>
	</view>
</template>

<script>
	import StoreItem from '../../templete/store/store_item.vue'
	import storeForm from '../../templete/store/store_out_item.vue'
	import machineItem from '../../templete/machine/machine_item.vue'
	import machineBreak from '../../templete/machine/machine_break_list_com.vue'
	export default {
		components:{storeForm,machineItem,machineBreak},
		data() {
			return {
				id:"",
				en:{
					id:'',
					type:'',
					status:''
				},
				log:""
			}
		},
		methods: {
			
			submit(){
				this.log(this.en)
				//检查数据
				// if(this.isnull(this.en.type)){this.$com.showToast('请选择类型');return;}
				// if(this.isnull(this.en.status)){this.$com.showToast('请选择状态');return;}
				// if(this.isnull(this.en.id)){this.$com.showToast('数据异常');return;}
				this.$api.patch("/api/machinePartOrders/confirm/" + this.id,{
					// type:this.$com.iriId(this.en.type)
				},(res)=>{
					this.log(res)
					if(res.s == 1){
						this.goback()
					}
				})
			}
		},
		onLoad(option) {
			this.id = option.id
			this.en.id = option.id
			this.$api.get("/api/machinePartOrders/" + this.id, {},res=>{
				this.log(res)
				this.clearLoading()
				this.log = res.d
			})
		}
	}
</script>

<style>

</style>
